#include "dcmwatchservice.h"
#include "dcmwatcher.h"
#include <QCoreApplication>

DcmWatchService::DcmWatchService(int argc, char **argv):
    w(0),
    QtService<QCoreApplication>(argc, argv, "Dicom Watcher Daemon")
{
    setServiceDescription("Scanning and monitoring service for dicom images.");
    setServiceFlags(QtServiceBase::NeedsStopOnShutdown);
    setStartupType(QtServiceController::AutoStartup);
}

void DcmWatchService::start()
{
    w = new DcmWatcher(qApp);
    w->startDcmWatch();
}

void DcmWatchService::stop()
{
    delete w;
    w = 0;
}

void DcmWatchService::pause()
{

}

void DcmWatchService::resume()
{

}

void DcmWatchService::processCommand(int code)
{

}
